package com.patterns.command.commonCommand;

import com.patterns.command.commonCommand.command.Command;
import com.patterns.command.commonCommand.command.ConcreteCommand;
import com.patterns.command.commonCommand.reveiver.ConcreteReciver;
import com.patterns.command.commonCommand.reveiver.Receiver;

/**
 * Created by Xiao Yiyun on 2017/5/16.
 * 场景类
 */
public class Client {
    public static void main(String[] args) {
        //首先声明调用者Invoker
        Invoker invoker = new Invoker();
        //定义接受者
        Receiver receiver = new ConcreteReciver();
        //定义一个发送给接受者的命令
        Command command = new ConcreteCommand(receiver);
        //把命令发给调用者去执行
        invoker.setCommand(command);
        invoker.action();
    }
}
